<?
include_once $_SERVER['DOCUMENT_ROOT'] . "/conf/config.php";

$dbconn = @mysql_connect($dbhost, $dbuser, $dbpass);
@mysql_select_db($dbname, $dbconn);

$member_query  = "insert into qr_members(username,userpass,CDATE,LDATE,rootuser) values('";
$member_query .= trim($_POST['newname']) . "','" . md5(trim($_POST['newpass'])) . "','";
$member_query .= date("Y-m-d") . "', '0000-00-00', 'N');";

$result = @mysql_query($member_query, $dbconn);

if ($result) echo json_encode('success');
else echo json_encode('error');
?>